#include <iostream>
#include <vector>
#include <iterator>
#include <algorithm>
#include <string>

#include "Engine.h"
#include "Scene.h"
#include "Camera.h"
#include "Mesh.h"
#include "SimpleMeshLoader.h"
#include "Renderer.h"
#include "Material.h"
using namespace std;



int main()
{	
	Engine *engine = new Engine( 640, 480, 32 );
	
	Scene *scene = engine->GetScene();
	
	Camera *camera = scene->CreateCamera();

	MeshLoader *sloader = new SimpleMeshLoader( "some\\path", engine->device );
	Mesh *mesh = scene->CreateMesh(sloader);
	mesh->SetPosition( 0 , 0, 10.f );

	while( !GetAsyncKeyState( VK_ESCAPE ) )
	{
		engine->Clear();

		if( GetAsyncKeyState( VK_SPACE ) )
		{
			D3DXQUATERNION rot = mesh->GetRotation();
			D3DXQUATERNION nrot;
			D3DXQuaternionRotationYawPitchRoll( &nrot, 0.001f, 0.001f, 0.001f );
			mesh->SetRotation( rot * nrot );
		}
		scene->Render();


		engine->SwapBuffers();
	}
}